﻿/******************************************************************************
 * Copyright (C) 2015  671643387@qq.com
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 *****************************************************************************/

#ifndef GAME_GAME_SHAREDDEFINES_H_
#define GAME_GAME_SHAREDDEFINES_H_

#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif

/************************************************************************/
/* 通用定义                                                             */
/************************************************************************/

/* 服务器响应码 */
enum ResponseCodes
{
	AUTH_OK = 0x0C,
	AUTH_FAILED = 0x0D,
	AUTH_UNAVAILABLE = 0x10,
	AUTH_VERSION_MISMATCH = 0x14,
	AUTH_UNKNOWN_ACCOUNT = 0x15,
	AUTH_WAIT_QUEUE = 0x1B,
	AUTH_BANNED = 0x1C,

    CHAR_CREATE_SUCCESS = 0x2E,
    CHAR_CREATE_ERROR = 0x2F,
    CHAR_CREATE_FAILED = 0x30,
    CHAR_CREATE_NAME_IN_USE = 0x31,
    CHAR_CREATE_DISABLED = 0x3A,

    CHAR_NAME_NO_NAME = 0x43,
    CHAR_NAME_TOO_SHORT = 0x44,
    CHAR_NAME_TOO_LONG = 0x45,
    CHAR_NAME_INVALID_CHARACTER = 0x46,
    CHAR_NAME_MIXED_LANGUAGES = 0x47,
    CHAR_NAME_RESERVED = 0x49,
    CHAR_NAME_SUCCESS = 0x50,
};

/* 阵营ID */
enum TeamId
{
    TEAM_ALLIANCE = 0,
    TEAM_HORDE,
    TEAM_NEUTRAL
};

/* 阵营 */
enum Team
{
    TEAM_NONE = 0,
    TEAM_BOTH_ALLOWED = 0,
    TEAM_INVALID = 1,
    HORDE = 67,
    ALLIANCE = 469,
};

/* 角色属性 */
enum Stats
{
    STAT_STRENGTH = 0,      /* 力量 */
    STAT_AGILITY = 1,       /* 敏捷 */
    STAT_STAMINA = 2,       /* 耐力 */
    STAT_INTELLECT = 3,     /* 智力 */
    STAT_SPIRIT = 4         /* 精神 */
};
#define MAX_STATS   5

/* 种族 */
enum Races
{
    RACE_HUMAN = 1,     // 人类
    RACE_ORC = 2,       // 兽人
    RACE_DWARF = 3,     // 矮人
    RACE_NIGHTELF = 4,  // 精灵
    RACE_UNDEAD = 5,    // 亡灵
    RACE_TAUREN = 6,    // 牛头人
    RACE_GNOME = 7,     // 侏儒
    RACE_TROLL = 8,     // 巨魔
    RACE_GOBLIN = 9,    // 哥布林
};
#define MAX_RACES   9
#define RACEMASK_ALL_PLAYABLE \
    ((1 << (RACE_HUMAN - 1)) | (1 << (RACE_ORC - 1)) | (1 << (RACE_DWARF - 1)) | \
    (1 << (RACE_NIGHTELF - 1)) | (1 << (RACE_UNDEAD - 1)) | (1 << (RACE_TAUREN - 1)) | \
    (1 << (RACE_GNOME - 1)) | (1 << (RACE_TROLL - 1)))

/* 职业 */
enum Classes
{
    CLASS_WARRIOR = 1,  // 战士
    CLASS_PALADIN = 2,  // 圣骑士
    CLASS_HUNTER = 3,   // 猎人
    CLASS_ROGUE = 4,    // 
    CLASS_PRIEST = 5,   // 牧师
    CLASS_SHAMAN = 7,   // 萨满
    CLASS_MAGE = 8,     // 法师
    CLASS_WARLOCK = 9,  // 术士
    CLASS_DRUID = 11,   // 德鲁伊
};
#define MAX_CLASSES       12
#define CLASSMASK_ALL_PLAYABLE \
    ((1 << (CLASS_WARRIOR - 1)) | (1 << (CLASS_PALADIN - 1)) | (1 << (CLASS_HUNTER - 1)) | \
    (1 << (CLASS_ROGUE - 1)) | (1 << (CLASS_PRIEST - 1)) | (1 << (CLASS_SHAMAN - 1)) | \
    (1 << (CLASS_MAGE - 1)) | (1 << (CLASS_WARLOCK - 1)) | (1 << (CLASS_DRUID - 1)))


/* 生物类型 */
enum CreatureType
{
    CREATURE_TYPE_BEAST = 1,            // 野兽
    CREATURE_TYPE_DRAGONKIN = 2,        // 龙族
    CREATURE_TYPE_DEMON = 3,            // 恶魔
    CREATURE_TYPE_ELEMENTAL = 4,        // 元素
    CREATURE_TYPE_GIANT = 5,            // 巨人
    CREATURE_TYPE_UNDEAD = 6,           // 亡灵
    CREATURE_TYPE_HUMANOID = 7,         // 人形
    CREATURE_TYPE_CRITTER = 8,          // 生物
    CREATURE_TYPE_MECHANICAL = 9,       // 机械
    CREATURE_TYPE_NOT_SPECIFIED = 10,   // 未分类
    CREATURE_TYPE_TOTEM = 11,           // 图腾
};

/* 生物类型标志 */
enum CreatureTypeFlags
{
    CREATURE_TYPEFLAGS_TAMEABLE = 0x00000001,       // 可被猎人驯服
    CREATURE_TYPEFLAGS_GHOST_VISIBLE = 0x00000002,  // 幽灵状态的角色依然可见，用于交互，不可攻击
    CREATURE_TYPEFLAGS_UNK3 = 0x00000004,           // "BOSS" flag for tooltips
    CREATURE_TYPEFLAGS_UNK4 = 0x00000008,
    CREATURE_TYPEFLAGS_UNK5 = 0x00000010,           // controls something in client tooltip related to creature faction
    CREATURE_TYPEFLAGS_UNK6 = 0x00000020,           // may be sound related
    CREATURE_TYPEFLAGS_UNK7 = 0x00000040,           // may be related to attackable / not attackable creatures with spells, used together with lua_IsHelpfulSpell/lua_IsHarmfulSpell
    CREATURE_TYPEFLAGS_UNK8 = 0x00000080,           // has something to do with unit interaction / quest status requests
    CREATURE_TYPEFLAGS_HERBLOOT = 0x00000100,       // Can be looted by herbalist
    CREATURE_TYPEFLAGS_MININGLOOT = 0x00000200,     // Can be looted by miner
    CREATURE_TYPEFLAGS_UNK11 = 0x00000400,          // no idea, but it used by client
    CREATURE_TYPEFLAGS_UNK12 = 0x00000800,          // related to possibility to cast spells while mounted
    CREATURE_TYPEFLAGS_CAN_ASSIST = 0x00001000,     // Can aid any player (and group) in combat. Typically seen for escorting NPC's
    CREATURE_TYPEFLAGS_UNK14 = 0x00002000,          // checked from calls in Lua_PetHasActionBar
    CREATURE_TYPEFLAGS_UNK15 = 0x00004000,          // Lua_UnitGUID, client does guid_low &= 0xFF000000 if this flag is set
    CREATURE_TYPEFLAGS_ENGINEERLOOT = 0x00008000,   // Can be looted by engineer
};

/* 技能类型 */
enum SkillType
{
    SKILL_NONE = 0,

    SKILL_FROST = 6,
    SKILL_FIRE = 8,
    SKILL_ARMS = 26,
    SKILL_COMBAT = 38,
    SKILL_SUBTLETY = 39,
    SKILL_POISONS = 40,
    SKILL_SWORDS = 43,
    SKILL_AXES = 44,
    SKILL_BOWS = 45,
    SKILL_GUNS = 46,
    SKILL_BEAST_MASTERY = 50,
    SKILL_SURVIVAL = 51,
    SKILL_MACES = 54,
    SKILL_2H_SWORDS = 55,
    SKILL_HOLY = 56,
    SKILL_SHADOW = 78,
    SKILL_DEFENSE = 95,
    SKILL_LANG_COMMON = 98,
    SKILL_RACIAL_DWARVEN = 101,
    SKILL_LANG_ORCISH = 109,
    SKILL_LANG_DWARVEN = 111,
    SKILL_LANG_DARNASSIAN = 113,
    SKILL_LANG_TAURAHE = 115,
    SKILL_DUAL_WIELD = 118,
    SKILL_RACIAL_TAUREN = 124,
    SKILL_ORC_RACIAL = 125,
    SKILL_RACIAL_NIGHT_ELF = 126,
    SKILL_FIRST_AID = 129,
    SKILL_FERAL_COMBAT = 134,
    SKILL_STAVES = 136,
    SKILL_LANG_THALASSIAN = 137,
    SKILL_LANG_DRACONIC = 138,
    SKILL_LANG_DEMON_TONGUE = 139,
    SKILL_LANG_TITAN = 140,
    SKILL_LANG_OLD_TONGUE = 141,
    SKILL_SURVIVAL2 = 142,
    SKILL_RIDING_HORSE = 148,
    SKILL_RIDING_WOLF = 149,
    SKILL_RIDING_TIGER = 150,
    SKILL_RIDING_RAM = 152,
    SKILL_SWIMING = 155,
    SKILL_2H_MACES = 160,
    SKILL_UNARMED = 162,
    SKILL_MARKSMANSHIP = 163,
    SKILL_BLACKSMITHING = 164,
    SKILL_LEATHERWORKING = 165,
    SKILL_ALCHEMY = 171,
    SKILL_2H_AXES = 172,
    SKILL_DAGGERS = 173,
    SKILL_THROWN = 176,
    SKILL_HERBALISM = 182,
    SKILL_GENERIC_DND = 183,
    SKILL_RETRIBUTION = 184,
    SKILL_COOKING = 185,
    SKILL_MINING = 186,
    SKILL_PET_IMP = 188,
    SKILL_PET_FELHUNTER = 189,
    SKILL_TAILORING = 197,
    SKILL_ENGINEERING = 202,
    SKILL_PET_SPIDER = 203,
    SKILL_PET_VOIDWALKER = 204,
    SKILL_PET_SUCCUBUS = 205,
    SKILL_PET_INFERNAL = 206,
    SKILL_PET_DOOMGUARD = 207,
    SKILL_PET_WOLF = 208,
    SKILL_PET_CAT = 209,
    SKILL_PET_BEAR = 210,
    SKILL_PET_BOAR = 211,
    SKILL_PET_CROCILISK = 212,
    SKILL_PET_CARRION_BIRD = 213,
    SKILL_PET_CRAB = 214,
    SKILL_PET_GORILLA = 215,
    SKILL_PET_RAPTOR = 217,
    SKILL_PET_TALLSTRIDER = 218,
    SKILL_RACIAL_UNDED = 220,
    SKILL_CROSSBOWS = 226,
    SKILL_WANDS = 228,
    SKILL_POLEARMS = 229,
    SKILL_PET_SCORPID = 236,
    SKILL_ARCANE = 237,
    SKILL_PET_TURTLE = 251,
    SKILL_ASSASSINATION = 253,
    SKILL_FURY = 256,
    SKILL_PROTECTION = 257,
    SKILL_BEAST_TRAINING = 261,
    SKILL_PROTECTION2 = 267,
    SKILL_PET_TALENTS = 270,
    SKILL_PLATE_MAIL = 293,
    SKILL_LANG_GNOMISH = 313,
    SKILL_LANG_TROLL = 315,
    SKILL_ENCHANTING = 333,
    SKILL_DEMONOLOGY = 354,
    SKILL_AFFLICTION = 355,
    SKILL_FISHING = 356,
    SKILL_ENHANCEMENT = 373,
    SKILL_RESTORATION = 374,
    SKILL_ELEMENTAL_COMBAT = 375,
    SKILL_SKINNING = 393,
    SKILL_MAIL = 413,
    SKILL_LEATHER = 414,
    SKILL_CLOTH = 415,
    SKILL_SHIELD = 433,
    SKILL_FIST_WEAPONS = 473,
    SKILL_RIDING_RAPTOR = 533,
    SKILL_RIDING_MECHANOSTRIDER = 553,
    SKILL_RIDING_UNDEAD_HORSE = 554,
    SKILL_RESTORATION2 = 573,
    SKILL_BALANCE = 574,
    SKILL_DESTRUCTION = 593,
    SKILL_HOLY2 = 594,
    SKILL_DISCIPLINE = 613,
    SKILL_LOCKPICKING = 633,
    SKILL_PET_BAT = 653,
    SKILL_PET_HYENA = 654,
    SKILL_PET_OWL = 655,
    SKILL_PET_WIND_SERPENT = 656,
    SKILL_LANG_GUTTERSPEAK = 673,
    SKILL_RIDING_KODO = 713,
    SKILL_RACIAL_TROLL = 733,
    SKILL_RACIAL_GNOME = 753,
    SKILL_RACIAL_HUMAN = 754,
    SKILL_PET_EVENT_RC = 758,
    SKILL_RIDING = 762,
};
#define MAX_SKILL_TYPE               763

#endif /* GAME_GAME_SHAREDDEFINES_H_ */
